﻿using B.S.Database.ErrorCode;
using B.S.Database.Write.Api.Application.Commands.Processing;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Database.Write.Api.Controllers
{

    /// <summary>
    /// 养殖控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessingController : ControllerBase
    {
        /// <summary>
        /// 中介者
        /// </summary>
        private readonly IMediator mediator;
        /// <summary>
        /// 日志
        /// </summary>
        private readonly ILogger<BreedingController> logger;

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator"></param>
        /// <param name="logger"></param>
        public ProcessingController(IMediator mediator, ILogger<BreedingController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 深加工设置
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Apiresult<object>> ProcessingCreate(ProcessingCreateCommands request)
        {
            return mediator.Send(request);
        }
        /// <summary>
        /// 供应商设置
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Apiresult<object>> SupplierCreate(SupplierCreateCommands request)
        {

            return mediator.Send(request); 
        }
        /// <summary>
        /// 企业信息设置
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Apiresult<object>> CompanyCreateess(CompanyCreateessCommands request)
        {

        return mediator.Send(request); 
        }
    
    }
    
    
}
